from datetime import datetime

from pydantic import BaseModel, Field
from schemas import GMT


class UserIn(BaseModel):
    name: str = Field(example="名称")
    avatar: str = Field(example="头像")
    image: str = Field(example="头像")
    hashed_password: str = Field(example="密码")
    roles: dict = Field(example="角色")
    routes: dict = Field(example="路由权限")
    buttons: dict = Field(example="按钮权限")


class UserCreate(UserIn):
    pass


class UserUpdate(UserIn):
    pass


class UserOut(UserIn, GMT):
    id: int = Field(example="编号")

    class Config:
        orm_mode = True
